package com.codenjoy.tdd;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class PrimeFactors {

    public List<Integer> get(int num) {
        if (num <= 1){
            return new ArrayList<Integer>();
        }

        ArrayList lst = new ArrayList();
        int d = num;
        int div = 2;
        while (d > 1){

            if (d % div == 0)
            {
                lst.add(div);
                d /= div;
            }
            else {
                div++;
            }
        }

        return lst;
    }
}
